var http = require('http');
var router = require('./router');

http.createServer(function(request,response){
	if(request.url !== '/favicon.ico'){
		var path = request.url.split('?')[0].replace(/\//,'');
		console.log(path);
		try {
			router[path](response,request);
		} catch (e) {
			router['home'](response,request);
		}
	}
})
.listen(3000);

console.log('server running at http://localhost:3000');
